package cn.edu.scau.cmi.liujianxun.client;

import java.io.IOException;

import cn.edu.scau.cmi.liujianxun.client.fxUI.hibernate.*;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class HibernateClient extends Application {

	private Stage primaryStage;
	
	public void start(Stage primaryStage) {
		this.primaryStage = primaryStage;
        this.primaryStage.setTitle("实验七 Hibernate");

        show();
	}

	public void show() {
        try {
        	java.net.URL location = getClass().getResource("fxUI/hibernate/HibernateDemo.fxml");
            FXMLLoader fxmlLoader = new FXMLLoader();
            fxmlLoader.setLocation(location);
            Parent root = fxmlLoader.load();
            HibernateDemoController controller = fxmlLoader.getController();   //获取Controller的实例对象
            //Controller中写的初始化方法
            controller.init();
        	
            Scene scene = new Scene(root);
            this.primaryStage.setScene(scene);
            this.primaryStage.show();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
	
	public static void main(String[] args) {
		launch(args);
	}
}
